using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableShoppingCartItem
	{
		public const string Table = "ShoppingCartItem";
		public const string ShoppingCartItemID = "ShoppingCartItemID";
		public const string ShoppingCartTempID = "ShoppingCartTempID";
		public const string VegetablesID = "VegetablesID";
		public const string PurchasePrice = "PurchasePrice";
		public const string Quantity = "Quantity";
		public const string Description = "Description";
		public const string BusinessID = "BusinessID";
		public const string IsConfirm = "IsConfirm";
		public const string OrderItemNo = "OrderItemNo";
	}
	
	[Serializable]
	public class BaseShoppingCartItem
		: IDbSessionEntity, IJsonClass
	{
		int m_ShoppingCartItemID;
		/// <summary>
        /// 
        /// </summary>
        public int ShoppingCartItemID
        {
            get { return m_ShoppingCartItemID; }
            set { m_ShoppingCartItemID = value; }
        }
		
		int? m_ShoppingCartTempID;
		/// <summary>
        /// 
        /// </summary>
        public int? ShoppingCartTempID
        {
            get { return m_ShoppingCartTempID; }
            set { m_ShoppingCartTempID = value; }
        }
		
		int m_VegetablesID;
		/// <summary>
        /// 
        /// </summary>
        public int VegetablesID
        {
            get { return m_VegetablesID; }
            set { m_VegetablesID = value; }
        }
		
		double m_PurchasePrice;
		/// <summary>
        /// 
        /// </summary>
        public double PurchasePrice
        {
            get { return m_PurchasePrice; }
            set { m_PurchasePrice = value; }
        }
		
		double m_Quantity;
		/// <summary>
        /// 
        /// </summary>
        public double Quantity
        {
            get { return m_Quantity; }
            set { m_Quantity = value; }
        }
		
		string m_Description;
		/// <summary>
        /// 
        /// </summary>
        public string Description
        {
            get { return m_Description; }
            set { m_Description = value; }
        }
		
		int m_BusinessID;
		/// <summary>
        /// 
        /// </summary>
        public int BusinessID
        {
            get { return m_BusinessID; }
            set { m_BusinessID = value; }
        }
		
		bool m_IsConfirm;
		/// <summary>
        /// 
        /// </summary>
        public bool IsConfirm
        {
            get { return m_IsConfirm; }
            set { m_IsConfirm = value; }
        }
		
		string m_OrderItemNo;
		/// <summary>
        /// 
        /// </summary>
        public string OrderItemNo
        {
            get { return m_OrderItemNo; }
            set { m_OrderItemNo = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ShoppingCartItemID = reader[TableShoppingCartItem.ShoppingCartItemID];
            m_ShoppingCartTempID = reader[TableShoppingCartItem.ShoppingCartTempID];
            m_VegetablesID = reader[TableShoppingCartItem.VegetablesID];
            m_PurchasePrice = reader[TableShoppingCartItem.PurchasePrice];
            m_Quantity = reader[TableShoppingCartItem.Quantity];
            m_Description = reader[TableShoppingCartItem.Description];
            m_BusinessID = reader[TableShoppingCartItem.BusinessID];
            m_IsConfirm = reader[TableShoppingCartItem.IsConfirm];
            m_OrderItemNo = reader[TableShoppingCartItem.OrderItemNo];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableShoppingCartItem.ShoppingCartItemID, PrimaryKeyType.Identity, ShoppingCartItemID);
			writer[TableShoppingCartItem.ShoppingCartTempID] = ShoppingCartTempID;
			writer[TableShoppingCartItem.VegetablesID] = VegetablesID;
			writer[TableShoppingCartItem.PurchasePrice] = PurchasePrice;
			writer[TableShoppingCartItem.Quantity] = Quantity;
			writer[TableShoppingCartItem.Description] = Description;
			writer[TableShoppingCartItem.BusinessID] = BusinessID;
			writer[TableShoppingCartItem.IsConfirm] = IsConfirm;
			writer[TableShoppingCartItem.OrderItemNo] = OrderItemNo;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ShoppingCartItemID = idd;
        }
		
		public string TableName
        {
            get { return TableShoppingCartItem.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ShoppingCartItemID = hashToRead["ShoppingCartItemID"];
			 
             m_ShoppingCartTempID = hashToRead["ShoppingCartTempID"];
			 
             m_VegetablesID = hashToRead["VegetablesID"];
			 
             m_PurchasePrice = hashToRead["PurchasePrice"];
			 
             m_Quantity = hashToRead["Quantity"];
			 
             m_Description = hashToRead["Description"];
			 
             m_BusinessID = hashToRead["BusinessID"];
			 
             m_IsConfirm = hashToRead["IsConfirm"];
			 
             m_OrderItemNo = hashToRead["OrderItemNo"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ShoppingCartItemID"] = ShoppingCartItemID;
			 
            hashToFill["ShoppingCartTempID"] = ShoppingCartTempID;
			 
            hashToFill["VegetablesID"] = VegetablesID;
			 
            hashToFill["PurchasePrice"] = PurchasePrice;
			 
            hashToFill["Quantity"] = Quantity;
			 
            hashToFill["Description"] = Description;
			 
            hashToFill["BusinessID"] = BusinessID;
			 
            hashToFill["IsConfirm"] = IsConfirm;
			 
            hashToFill["OrderItemNo"] = OrderItemNo;
			 
        }

        #endregion
		
	}
}
